from tkinter import *
root = Tk()

#
menu = Menu(root)
def callback():			
      print('this is menu')
for item in ['文件','编辑','视图','格式']:
      menu.add_command(label=item,
      command=callback)
root['menu'] = menu
root.mainloop()
